<?php
/**
 * CreateTime: 2023/2/15 15:33
 */

namespace App\Enum\MeExtensionsStatusEnum;

use App\Consts\MeLawCaseConsts\MeLawCaseConsts;
use App\Enum\BaseEnumInterface;

class MeExtensionsStatusEnum implements BaseEnumInterface
{
    public static function getEnumMeaningByEnumCode($enumCode)
    {
        switch ($enumCode){
            case MeLawCaseConsts::ME_LAW_CASE_DFP_1:
                return "待分配";
            case MeLawCaseConsts::ME_LAW_CASE_YFP_2:
                return "已分配待受理";
            case MeLawCaseConsts::ME_LAW_CASE_WHTJZ_3:
                return "外呼调解中";
            case MeLawCaseConsts::ME_LAW_CASE_RYTJZ_4:
                return "人员调解中";
            case MeLawCaseConsts::ME_LAW_CASE_SSZ_5:
                return "诉讼中";
            case MeLawCaseConsts::ME_LAW_CASE_ZXZ_6:
                return "执行中";
            case MeLawCaseConsts::ME_LAW_CASE_JA_7:
                return "结案";
            case MeLawCaseConsts::ME_LAW_CASE_JAWHK_8:
                return "结案未回款";
            case MeLawCaseConsts::ME_LAW_CASE_YSL_9:
                return "已受理";
            default:
                return false;
        }
    }

    public static function getEnumMapList(){
        $arr = [1,2,3,4,5,6,7,8,9];
        $map = [];
        foreach($arr as $key=>$value){
            $map[$key] = [
                'key' => $key,
                'label' => self::getEnumMeaningByEnumCode($value),
                'value' => $value
            ];
            switch ($value){
                case 1:
                    $map[$key]['type'] = "default";
                    break;
                case 2:
                    $map[$key]['type'] = "warning";
                    break;
                case 7:
                case 9:
                    $map[$key]['type'] = "success";
                    break;
                case 8:
                    $map[$key]['type'] = "error";
                    break;
                default:
                    $map[$key]['type'] = "processing";
                    break;
            }
        }
        return $map;
    }
}